<%@ page language="java" contentType="text/html; charset=utf-8"  pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> 


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>汽车贷款登陆 - </title>

<link href="res/denglu/css/main.css" rel="stylesheet" type="text/css" />

</head>

<script type="text/javascript">
     function testajax () {

            // body...
            var yonghuming=document.getElementById("yonghuming").value;
            var mima=document.getElementById("mima").value;
            // alert("op");
            $.ajax( {  
     url:'ydenglu',// 跳转到 action url:表示后面跟访问地址 
     // contentType: "application/x-www-form-urlencoded; charset=utf-8",
     data:{  
                yonghuming:yonghuming,
                mima:mima,
                //data:后面跟参数
               text:'dsf'
      },  
     type:'post',  
     cache:false,  
     async:false,
    success:function(data) {  
        // var s = "登陆成功";
        // 当请求成功之后，返回的数据就在这做处理，我现在只是做了一个简单的弹出。
        // response.setCharacterEncoding("UTF-8");
        var obj = JSON.parse(data);
        var u ="正确"
        var qx="管理员"
        var yh="用户"
        var hy="员工"
  
        if (obj.f==u&&obj.q==yh){
            window.location.href="http://localhost:8081/daikuan/zhuye?";
        }else if (obj.f==u&&obj.q==qx || obj.f ==u && obj.q== hy) {
              window.location.href="http://localhost:8081/daikuan/htzhuye?";
        }else{
        	alert(obj.f);
        };
         
      },  
     error : function() {  
          // view("异常！");  请求失败的时候，在这里做处理
           alert("异常！");  
      }  
 });
        }        
</script>

<!--验证-->

<body>


<div class="login">
    <div class="box png">
		<div class="logo png"></div>
		<div class="input">
			<div class="log">
				<div class="name">
					<label>用户名</label><input type="text" class="text" id="yonghuming" placeholder="用户名" name="yonghuming" tabindex="1">
				</div>
				<div class="pwd">
					<label>密　码</label><input type="password" class="text" id="mima" placeholder="密码" name="mima" tabindex="2">
					<input type="button" class="submit" tabindex="3" value="登录" onclick=" testajax();return false;">
					<div class="check"></div>
				</div>
				<div class="tip"></div>
			</div>
		</div>
	</div>
    <div class="air-balloon ab-1 png"></div>
	<div class="air-balloon ab-2 png"></div>
    <div class="footer"></div>
</div>

<script type="text/javascript" src="res/denglu/js/jQuery.js"></script>
<script type="text/javascript" src="res/denglu/js/fun.base.js"></script>
<script type="text/javascript" src="res/denglu/js/script.js"></script>


<!--[if IE 6]>
<script src="js/DD_belatedPNG.js" type="text/javascript"></script>
<script>DD_belatedPNG.fix('.png')</script>
<![endif]-->
<div style="text-align:center;margin:50px 0; font:normal 14px/24px 'MicroSoft YaHei';">
<!-- <p>适用浏览器：360、FireFox、Chrome、Safari、Opera、傲游、搜狗、世界之窗. 不支持IE8及以下浏览器。</p> -->
<p>还没帐号？ <!-- <a href="http://www.cssmoban.com/" target="_blank" title="模板之家">模板之家</a> --> -  <a href="zhuceye?" title="网页模板" target="_blank">去注册</a></p>
</div>
</body>
</html>